Skip to content

fix(lua): a float shown during a question gives the keyboard back to it - #209

Merged
joshzcold merged 2 commits into
mainfrom
fix/float-keeps-prompt-keyboard
Nov 23, 2026
Merged

joshzcold merged 2 commits into
mainfrom
fix/float-keeps-prompt-keyboard

Conversation

@joshzcold

Copy link
Copy Markdown
Owner

Summary

  • Showing a float's overlay (set_visible(1) in float::reposition) takes the keyboard. Outside a question riptide hands it back to the tab; during one (#84c222a) it handed it to nothing, so keys went to the float and the question couldn't be typed into.
  • Found through the passwords plugin: its status float appeared while Bitwarden's master password question was open, and the question was dead (fix(passwords): keep the status float away while a password is asked for riptide-plugins#24 works around it on the plugin side).
  • Now, during a prompt or yes/no question, the keyboard goes back to the status bar, which takes a question's keys (shell::focus_for_prompt).

Testing

  • New e2e a_float_shown_during_a_question_leaves_it_the_keyboard types real X keys with xdotool (the test channel skips focus): it times out in prompt mode without the fix and passes with it.
  • lua_events, plugins and window_settings e2e suites pass (42 tests); cargo fmt --check and clippy are clean.

Showing a float's overlay takes the keyboard. Outside a question riptide hands
it back to the tab, but during one it handed it to nothing, so the keys went
to the float and the question could no longer be typed into, e.g. a password
manager's master password while its status float appeared. The status bar,
which takes a question's keys, now gets them back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@joshzcold joshzcold left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the diff against shell::focus_for_prompt. Looks good to merge; one optional nit.

Fix (float.rs): correct. It gives the keyboard back the same way focus_for_prompt does:

  • Same mode set (Prompt | YesNo, as in shell.rs:812).
  • Same target (s.statusbar); the bar is already focusable at that point, since entering the prompt set it.
  • The early if !shown { return; } also saves the shell::with call on every resize where nothing was newly shown.

A float with its own keys can't take keys while a question is open, since they reach it through the tab. That's the right priority: the question wins.

Test: good to drive real X keys, since the test channel skips focus. The wait_mode("prompt"), then float, then placed ordering avoids the obvious race. xdotool is already installed in check.yml's e2e job.

Nit: the two Command::new("xdotool") blocks could be one call, since xdotool chains commands: xdotool type --delay 20 hunter2 key Return. Or use a small closure, as input_settings.rs does.

I didn't run the e2e test locally; I'm relying on the author's run and CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joshzcold
joshzcold merged commit 8929dd2 into main Nov 23, 2026
9 of 10 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
@joshzcold
joshzcold deleted the fix/float-keeps-prompt-keyboard branch November 23, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant